xen/arm64: head: Introduce a macro to get a PC-relative address of a symbol
authorJulien Grall <julien.grall@arm.com>
Mon, 17 Jun 2019 13:51:21 +0000 (14:51 +0100)
committerJulien Grall <julien.grall@arm.com>
Sat, 7 Sep 2019 11:09:49 +0000 (12:09 +0100)
commitb352d468f4d2f12f8ee6a0f6d81cdd8010cc8699
tree5f80ce5f353c69496df9f8ca52160aefd4b224a1
parent64f996dee1a3cef9d5bcbd566522316ba133a1f8
xen/arm64: head: Introduce a macro to get a PC-relative address of a symbol

Arm64 provides instructions to load a PC-relative address, but with some
limitations:
   - adr is enable to cope with +/-1MB
   - adrp is enale to cope with +/-4GB but relative to a 4KB page
     address

Because of that, the code requires to use 2 instructions to load any Xen
symbol. To make the code more obvious, introducing a new macro adr_l is
introduced.

The new macro is used to replace a couple of open-coded use in
efi_xen_start.

The macro is copied from Linux 5.2-rc4.

Signed-off-by: Julien Grall <julien.grall@arm.com>
Acked-by: Stefano Stabellini <sstabellini@kernel.org>
xen/arch/arm/arm64/head.S